<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
<link rel="stylesheet" type="text/css" media="screen" href="../../css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" media="screen" href="../../css/dataTables.bootstrap.min.css">
<link rel="stylesheet" href="../../layui/css/layui.css" media="all" />
</head>
<body>
    <div>
        <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12">
            <div>
                <header style="height: 100%">
                    <div align="left">
	                    <table style="width: 100%">
	                   		<tr>
	                   			<td>
		                   			<form class="form-inline" onsubmit="return false">
										<div class="form-group">
											id：
											<input id="id" type="text" class="form-control" placeholder="id">
											<button id="searchBt" class="layui-btn layui-btn-sm"><i class="layui-icon">&#xe615;</i>搜索</button>
										</div>
									</form>
	                   			</td>
	                   			<td align="right">
	                   				<button class="layui-btn layui-btn-sm" onclick="location.href='addAppTradePayno.html'">
                                      <i class="layui-icon">&#xe608;</i> 添加
                                    </button>
	                   			</td>
	                   		</tr> 
	                    </table>
					</div>
                </header>
                
                <div>
                    <div class="widget-body no-padding">
                        <table id="dt-table" class="table table-striped table-bordered table-hover" style="width:100%">
                            <thead>
                                <tr>
                                </tr>                       
                                <tr>
									<th>fid</th>
									<th>tradepaynoid</th>
									<th>outtradeno</th>
									<th>authcode</th>
									<th>totalamount</th>
									<th>subject</th>
									<th>hostcode</th>
									<th>refundno</th>
									<th>notifyid</th>
									<th>notifytime</th>
									<th>buyeremail</th>
									<th>selleremail</th>
									<th>gmtcreate</th>
									<th>batchno</th>
									<th>gmtrefund</th>
									<th>refundstatus</th>
									<th>applypeople</th>
									<th>applyphone</th>
									<th>applysocial</th>
									<th>patientname</th>
									<th>patientsex</th>
									<th>patientsocial</th>
									<th>patientphone</th>
									<th>orderstatus</th>
									<th>feestatus</th>
									<th>orderno</th>
									<th>tradeno</th>
									<th>orderdate</th>
									<th>patientid</th>
									<th>times</th>
									<th>paytype</th>
									<th>chequtype</th>
									<th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>

<script type="text/javascript" src="../../js/libs/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="../../js/jq.js"></script>
<script type="text/javascript" src="../../js/plugin/datatables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="../../js/plugin/datatables/dataTables.bootstrap.min.js"></script>
<script type="text/javascript" src="../../layui/layui.js"></script>
<script type="text/javascript" src="../../js/my/permission.js"></script>
<script type="text/javascript">
var pers = checkPermission();

var example;
function init(){
	example = 
    	$('#dt-table').DataTable({
        	"searching": false,
        	"processing": false,
        	"serverSide" : true,
        	"language": {
                "url": "/js/plugin/datatables/Chinese.lang"
            },
        	"ajax": {
        		"url" : "/appTradePaynos",
        		"type":"get",
        		"data":function(d){
    				d.id = $("#id").val();
    			}
        	},
        	"dom": "<'dt-toolbar'r>t<'dt-toolbar-footer'<'col-sm-10 col-xs-12 hidden-xs'i><'col-xs-12 col-sm-10' p v>>",	
            "columns": [
				{"data" : "fid", "defaultContent" : ""},
				{"data" : "tradepaynoid", "defaultContent" : ""},
				{"data" : "outtradeno", "defaultContent" : ""},
				{"data" : "authcode", "defaultContent" : ""},
				{"data" : "totalamount", "defaultContent" : ""},
				{"data" : "subject", "defaultContent" : ""},
				{"data" : "hostcode", "defaultContent" : ""},
				{"data" : "refundno", "defaultContent" : ""},
				{"data" : "notifyid", "defaultContent" : ""},
				{"data" : "notifytime", "defaultContent" : ""},
				{"data" : "buyeremail", "defaultContent" : ""},
				{"data" : "selleremail", "defaultContent" : ""},
				{"data" : "gmtcreate", "defaultContent" : ""},
				{"data" : "batchno", "defaultContent" : ""},
				{"data" : "gmtrefund", "defaultContent" : ""},
				{"data" : "refundstatus", "defaultContent" : ""},
				{"data" : "applypeople", "defaultContent" : ""},
				{"data" : "applyphone", "defaultContent" : ""},
				{"data" : "applysocial", "defaultContent" : ""},
				{"data" : "patientname", "defaultContent" : ""},
				{"data" : "patientsex", "defaultContent" : ""},
				{"data" : "patientsocial", "defaultContent" : ""},
				{"data" : "patientphone", "defaultContent" : ""},
				{"data" : "orderstatus", "defaultContent" : ""},
				{"data" : "feestatus", "defaultContent" : ""},
				{"data" : "orderno", "defaultContent" : ""},
				{"data" : "tradeno", "defaultContent" : ""},
				{"data" : "orderdate", "defaultContent" : ""},
				{"data" : "patientid", "defaultContent" : ""},
				{"data" : "times", "defaultContent" : ""},
				{"data" : "paytype", "defaultContent" : ""},
				{"data" : "chequtype", "defaultContent" : ""},
				{ 
								"data": "", 
								"defaultContent": "",
								"orderable":false,
						        "render": function (data, type, row) {
                		           var id = row['id'];
                		           var href = "updateAppTradePayno.html?id=" + id;
                                   var edit = buttonEdit(href, "", pers);
                		           var del = buttonDel(id, "", pers);
                                   return edit + del;
                  	            }		
							},
                
            ],
           "order": [[ 0, "asc" ]]
        } );
}

layui.use('layer', function(){
    var layer = layui.layer;
});

function del(id){
	layer.confirm('确定要删除吗？', {
        btn : [ '确定', '取消' ]
    }, function() {
    	$.ajax({
            type : 'delete',
            url : '/appTradePaynos/'+id,
            success : function(data) {
                example.ajax.reload();
                layer.msg("删除成功");
            }
        });
        
        layer.close(1);
    });
}

$("#searchBt").click(function(){
	example.ajax.reload();
});

init();
</script>
